package com.jade.framework.web.ajax;

import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;

/**
 * Ajax方式下，后端返回给前端的对象
 *
 * @author yfyang
 * @version 1.0 13-4-22 下午10:31
 * @deprecated
 */
public class AjaxResult implements Serializable
{
    private int status = 200;
    private long total;
    private Object[] rows;
    private Map<String, Object> params = new HashMap<String, Object>();
    //客户端带的参数，直接返回。Datatables需要使用
    private String callback;

    public Object[] getRows()
    {
        return rows;
    }

    public void setRows(Object[] rows)
    {
        this.rows = rows;
    }

    public Map<String, Object> getParams()
    {
        return params;
    }

    public Object getParam(Object key)
    {
        return params.get(key);
    }

    public void setParams(Map<String, Object> params)
    {
        this.params = params;
    }

    public void setParam(String key, Object value)
    {
        params.put(key, value);
    }

    public long getTotal()
    {
        return total;
    }

    public void setTotal(long total)
    {
        this.total = total;
    }

    public int getStatus()
    {
        return status;
    }

    public void setStatus(int status)
    {
        this.status = status;
    }

    public String getCallback()
    {
        return callback;
    }

    public void setCallback(String callback)
    {
        this.callback = callback;
    }
}
